<!DOCTYPE html>
<html>
	<head>
		<title>
		</title>
	</head>
	<body>
	<script>
	    var users=["qiang","admin","woniuxy","hello"];
		var passes=["1234","2234","3234","4234"];
		var username=prompt("请输入用户名：");
		for(var i=0;i<users.length;i++)
		{
			if(username==users[i])
			{
				password=prompt("请输入密码：");
				if(password==passes[i])
				{
					document.write("登录成功!");
				}
				else{
					document.write("密码错误!")
				}
				break;
			}
		    else
			{   
				if(i==users.length-1)
				{
				document.write("用户名错误!")
				}
			}
		}
		
		</script>
	</body>
</html>